Conversation
3 tasks
The previous PR fixed the bug where BLOB columns were incorrectly reported as 'binary' type. This commit updates all test expectations to reflect the correct behavior: - Binary/varbinary columns that auto-convert to BLOB in MySQL now correctly return as 'blob', 'tinyblob', 'mediumblob', or 'longblob' instead of incorrectly returning as 'binary' - BLOB column types now properly round-trip (blob->blob, tinyblob->tinyblob) - Fixes PHPStan error and test assertion for tinyblob SQL type This completes the fix for issue #484. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
markstory
reviewed
Oct 6, 2025
markstory
reviewed
Oct 7, 2025
Comment on lines
+1131
to
+1132
| ['tinyblob', 'tinyblob', null, MysqlAdapter::BLOB_TINY], | ||
| ['tinyblob', 'tinyblob', MysqlAdapter::BLOB_TINY, MysqlAdapter::BLOB_TINY], |
Member
There was a problem hiding this comment.
How should we go about changing these types in the future? When we drop support for phinx in migrations, it would be beneficial to align with cakephp/database which uses type=binary and length parameters.
Member
Author
There was a problem hiding this comment.
Good question
I added a test case for those as well now. You can check and if necessary adjust.
How it works:
The code in MysqlAdapter.php already:
- Uses PHINX_TYPE_BINARY = TableSchemaInterface::TYPE_BINARY (line 50 in AdapterInterface.php)
- Has blob constants aligned with CakePHP: BLOB_TINY = TableSchema::LENGTH_TINY, etc. (lines 72-76)
- mapColumnData() handles both APIs and converts to CakePHP's type='binary' with length (lines 286-317)
- CakePHP's MysqlSchemaDialect generates the correct SQL (TINYBLOB, MEDIUMBLOB, etc.) based on the length
Future work (when Phinx support is dropped):
You could:
- Deprecate Phinx-style blob types (tinyblob, mediumblob, longblob)
- Remove the round-trip conversion in mapColumnType() that converts back to blob types
- Keep only 'binary' with length parameter - fully aligned with CakePHP core
- This would be a breaking change requiring coordination with a major version bump
Member
Author
There was a problem hiding this comment.
I had to revert, those didnt pass.
Feel free to add ammending commits to what you see fit. I just tried to get this ticket resolved.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Might resolve #484